package com.droidski.taskdb.model;

import java.io.Serializable;


/**
 * any piece of history has a status
 */
public enum Status implements Serializable {
	
	NOT_STARTED("n"), 
	PAUSED("p"), 
	COMPLETED("c"), 
	ACTIVE("a"), 
	ABANDONED("x");
	
	public static Status from(String s) {
		for ( Status status : Status.values() ) {
			if ( status.statusCode.equals(s) ) {
				return status;
			}
		}
		return null;
	}

	String statusCode;
	
	private Status(String statusCode) {
		this.statusCode = statusCode;
	}
	
	@Override
	public String toString() {
		return statusCode;
	}
	
	public String toLongString() {
		return super.toString();
	}
  
}


